You type:
*Italic*, **bold** super^script^ and a [link](www.gov.uk).
You get:
Italic, bold, superscript and a link.
14 May 2018
This talk isn't about coding.
It's about improving what we do.
The Excel-Word approach is looooong and error-prone. Exaggerated example:
Questions to ask yourself:
We can reduce error and go faster with R Markdown.
A document with filetype .Rmd in which you:
*, [], ^, etc)This is already being done in the department and across government (Reproducible Analytical Pipelines).
Enclosed in three hyphens. Specify metadata and what output should be produced.
---
title: "Your title"
author: "Your name"
date: "The date"
output:
word_document:
reference_docx: mystyles.docx
highlight: "tango"
---
You type:
*Italic*, **bold** super^script^ and a [link](www.gov.uk).
You get:
Italic, bold, superscript and a link.
You can write some R code in the middle of a sentence!
Wrap the code in backticks (the button under the Esc key) and start it with the letter r.
You type:
The answer to 1 + 1 is `r 1 + 1`
You get:
The answer to 1 + 1 is 2
Let's say my_value <- "Lotad"
You type:
The best Pokemon is `r my_value`
You get:
The best Pokemon is Lotad
You type:
Here's an important plot of chick weights and feed types.
```{r chicks}
chickwts %>%
group_by(feed) %>%
ggplot() +
geom_col(aes(x = feed, y = weight))
```
You get:
Here's an important table of chick weights and feed types.
DEMO TIME!
Your R Markdown is rendered into 'plain' markdown by the package knitr (hence why you 'knit' to render the document), then something called pandoc converts it from markdown to your output format.
.Rmd ➡️ knitr ➡️ .md ➡️ pandoc ➡️ .html/.pdf/.docx
This isn't essential knowledge.